﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UserLINQ.Types;

namespace Filters
{
	class UserFilter: IFilter<User>
	{
		public string FirstName { get; set; }
		public string Patronymic { get; set; }
		public string LastName { get; set; }


		public IEnumerable<User> Filter(List<User> users, string FirstName = "", string Patronymic = "", string LastName = "")
		{
			return from User usr in users
				   where usr.LastName.Contains(FirstName) &&
							   usr.FirstName.Contains(Patronymic) &&
							   usr.Patronymic.Contains(LastName)
				   select usr;
		}

	}
}
